﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;

namespace Aplicacao
{
    public class Usuario
    {
        public DataTable VerificaUsuarioCadastrado(string cpf, SqlConnection connection)
        {
            SqlCommand cmd = new SqlCommand("select * from tb_internauta where cpf = @cpf");
            cmd.Parameters.AddWithValue("@cpf", cpf);
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            da.SelectCommand.Connection = connection;
            DataTable dt = new DataTable();
            da.Fill(dt);
            if (dt.Rows.Count > 0)
                return dt;
            return null;
        }
    }
}